import 'package:enterprise_v6_app/app/core/core.dart';
import 'package:floating_overlay/floating_overlay.dart';

/// 悬浮按钮工具类
class HoverButtonUtil {

  // 滑动弹窗
  static late FloatingOverlayController slideController;

  // 开启悬浮
  static open() async {
    slideController = FloatingOverlayController.absoluteSize(
      maxSize: Size(50.w, 50.w),
      minSize: Size(49.w, 49.w),
      start: Offset(Get.width - 80, Get.height - 150),
      padding: const EdgeInsets.all(10.0),
      constrained: true,
    );
    await Future.delayed(const Duration(milliseconds: 2000));
    slideController.show();
  }

  // 关闭悬浮
  static closeHover() async {
    slideController.hide(true);
  }

}